<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>BOM学习</title>
</head>
<body>
	<script type="text/javascript">
	//解析查询字符串
	function queryStr () {
		var query = location.search.length > 0 ? location.search.substring(1) : "";
		var args  = {};
		var items = query.length > 0 ? query.split("&") : [];
		console.log(items);
		var item  = null,name = null,value = null;
		var i     = 0;
		var len   = items.length;
		for(i = 0; i < len; i++) {
			item = items[i].split("=");
			name = decodeURIComponent(item[0]);
			value = decodeURIComponent(item[1]);
			if (name.length) {
				args[name] = value;
			}
		}
		return args; 
	}

	var args = queryStr();
	console.log(args);
	</script>

</body>
</html>